<?php

include("../phpmailer/class.phpmailer.php");
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mailFrom=$_POST['email'];
$mailName=$_POST['name'];
$mailBody=$_POST['message'];


$mail             = new PHPMailer();


$mail->IsSMTP();
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
$mail->Port       = 465;                   // set the SMTP port for the GMAIL server

$mail->Username   = "karthikarul20@gmail.com";  // GMAIL username
$mail->Password   = "9944200629.a";            // GMAIL password

$mail->AddReplyTo("karthikarul20@gmail.com","Karthik");

$mail->From       = $mailFrom;
$mail->FromName   = $mailName;

$mail->Subject    = "Contact Email from User: " . $mailName;

//$mail->Body       = "Hi,<br>This is the HTML BODY<br>";                      //HTML Body
$mail->WordWrap   = 50; // set word wrap

$mail->Body    = $mailBody;

$mail->AddAddress("arvind.discover@gmail.com", "Arvind");
$mail->AddAddress("karthikarul20@gmail.com", "Karthik");
$mail->AddAddress("steffi.saga@gmail.com", "Steffi");


$mail->IsHTML(true); // send as HTML

if(!$mail->Send()) {
      header("location: contact.php");
    	exit();
} else {
 
	header("location: index.php");
	exit();
}

?>
